# ~*~ coding: utf-8 ~*~

from apps.blueprints import assets_blueprint
from .views import AssetListAPI, AssetListView, AssetUpdateView, AssetCreateView, AssetDeleteView, \
    AssetConnectivityView, AssetHardwareView
from .views import AdminUserListAPI, AdminUserListView, AdminUserUpdateView, AdminUserCreateView, AdminUserDeleteView
from .views import SystemUserListAPI, SystemUserListView, SystemUserUpdateView, SystemUserCreateView, SystemUserDeleteView
from .views import NodeTreeAPI, NodeTreeView, NodeAddChildrenAPI, NodeDeleteAPI, NodeRenameAPI, NodeMoveChildrenAPI
from .views import AuthListAPI, AuthListView, AuthUpdateView, AuthCreateView, AuthDeleteView


# asset
assets_blueprint.add_url_rule('/api/asset/', view_func=AssetListAPI.as_view('api-asset-list'))
assets_blueprint.add_url_rule('/asset/', view_func=AssetListView.as_view('asset-list'))
assets_blueprint.add_url_rule('/asset/create/', view_func=AssetCreateView.as_view('asset-create'))
assets_blueprint.add_url_rule('/asset/<uuid:pk>/update/', view_func=AssetUpdateView.as_view('asset-update'))
assets_blueprint.add_url_rule('/asset/<uuid:pk>/delete/', view_func=AssetDeleteView.as_view('asset-delete'))
assets_blueprint.add_url_rule('/asset/<uuid:pk>/connectivity/', view_func=AssetConnectivityView.as_view('asset-connectivity'))
assets_blueprint.add_url_rule('/asset/<uuid:pk>/hardware/', view_func=AssetHardwareView.as_view('asset-hardware'))

# admin-user
assets_blueprint.add_url_rule('/api/adminuser/', view_func=AdminUserListAPI.as_view('api-adminuser-list'))
assets_blueprint.add_url_rule('/adminuser/', view_func=AdminUserListView.as_view('adminuser-list'))
assets_blueprint.add_url_rule('/adminuser/create/', view_func=AdminUserCreateView.as_view('adminuser-create'))
assets_blueprint.add_url_rule('/adminuser/<uuid:pk>/update/', view_func=AdminUserUpdateView.as_view('adminuser-update'))
assets_blueprint.add_url_rule('/adminuser/<uuid:pk>/delete/', view_func=AdminUserDeleteView.as_view('adminuser-delete'))

# admin-user
assets_blueprint.add_url_rule('/api/systemuser/', view_func=SystemUserListAPI.as_view('api-systemuser-list'))
assets_blueprint.add_url_rule('/systemuser/', view_func=SystemUserListView.as_view('systemuser-list'))
assets_blueprint.add_url_rule('/systemuser/create/', view_func=SystemUserCreateView.as_view('systemuser-create'))
assets_blueprint.add_url_rule('/systemuser/<uuid:pk>/update/', view_func=SystemUserUpdateView.as_view('systemuser-update'))
assets_blueprint.add_url_rule('/systemuser/<uuid:pk>/delete/', view_func=SystemUserDeleteView.as_view('systemuser-delete'))

# node
assets_blueprint.add_url_rule('/node/tree/', view_func=NodeTreeView.as_view('node-list'))
assets_blueprint.add_url_rule('/api/node/tree/', view_func=NodeTreeAPI.as_view('api-node-tree'))
assets_blueprint.add_url_rule('/api/node/<uuid:pk>/add/children/', view_func=NodeAddChildrenAPI.as_view('api-node-add-children'))
assets_blueprint.add_url_rule('/api/node/<uuid:pk>/delete/', view_func=NodeDeleteAPI.as_view('api-node-delete'))
assets_blueprint.add_url_rule('/api/node/<uuid:pk>/rename/', view_func=NodeRenameAPI.as_view('api-node-rename'))
assets_blueprint.add_url_rule('/api/node/<uuid:pk>/move/children/', view_func=NodeMoveChildrenAPI.as_view('api-node-move-children'))

# auth
assets_blueprint.add_url_rule('/api/auth/', view_func=AuthListAPI.as_view('api-auth-list'))
assets_blueprint.add_url_rule('/auth/', view_func=AuthListView.as_view('auth-list'))
assets_blueprint.add_url_rule('/auth/create/', view_func=AuthCreateView.as_view('auth-create'))
assets_blueprint.add_url_rule('/auth/<uuid:pk>/update/', view_func=AuthUpdateView.as_view('auth-update'))
assets_blueprint.add_url_rule('/auth/<uuid:pk>/delete/', view_func=AuthDeleteView.as_view('auth-delete'))
